<%@ Page Language="C#" MasterPageFile="~/Common/WebSiteMaster.master" AutoEventWireup="true" CodeBehind="A_AjaxExtensions.aspx.cs" Inherits="ScottCateAjax2008.Lesson06.A_AjaxExtensions" Title="AJAX Extensions and Shortcuts" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

    <asp:ScriptManager id="SM1" runat="server">
        <scripts>
            <asp:ScriptReference path="A_AjaxExtensions.aspx.js" />
        </scripts>
    </asp:ScriptManager>
    <div id="main">
        <ul>
            <li>document.getelementById = $get : used for html elements</li>
            <li>$find = used for behaviors</li>
            <li>$addHandler = easy way to add function delegates to controls</li>
            <li>$addHandlers = add an array of delegates</li>
            <li>$removeHandler = remove a single handler from an event</li>
            <li>$clearHandlers = remove all handlers from an event. (be careful)</li>
        </ul>
        
        <input type="text" id="textInput" />
        
        <input type="button" value="Test $get() Alert" onclick="testGet();" />
        <hr />
        
        <input type="button" value="Add Button Handler" onclick="testAddHandler();" /><br />
        <input type="button" value="Remove Button Handler" onclick="testRemoveHandler();" /><br />
        <input type="button" value="Clear all Button Handler(s)" onclick="testClearHandlers();" /><br />
        <input type="button" value="Add Mouse Over Event" onclick="testAddMouseOverHandler();" /><br />
        <input type="button" value="Target Button" id="mainButton" />
        
        <hr />
        
        <input type="button" value="Add Multiple Handlers" onclick="testAddHandlers();" /><br />
        <input type="button" value="Target Button" id="handlerButton" />
    </div>
    
</asp:Content>
